package com.itheima.demo;

import com.itheima.domain.User;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.util.List;

public class Demo2 {
    public static void main(String[] args) throws IOException {
        SqlSessionFactory f = new SqlSessionFactoryBuilder().build(Resources.getResourceAsReader("sql.xml"));
        SqlSession session = f.openSession();
        List<User> one = session.selectList("one.findAll");
        System.out.println(one);
        session.close();
    }
}
